#ifndef compass_h
#define compass_h
#include <MatrixMath.h>
#include <math.h>

typedef struct vector
{
  float x, y, z;
} vector;

extern void vector_cross(const vector *a, const vector *b, vector *out);
extern float vector_dot(const vector *a,const vector *b);
extern vector vector_sum(vector *a,vector *b);
extern void vector_normalize(vector *a);

/* Base class (virtual) */
class compass
{
	public:
		vector a; //accelerometer	
		vector m; //magnetometer

		float yaw,pitch,roll;
	
		compass();
		void enable(void);
		virtual void read(void);
		void attitude(void);	
};


#endif
